package com.lmj.mybatisPlus.entry.po;

import cn.hutool.core.annotation.Alias;
import com.baomidou.mybatisplus.annotation.*;
import lombok.*;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * @classDesc: 功能描述:
 * @author: 李明杰
 * @date: 2021/11/10 11:20
 * @copyright
 */
@Data
@TableName(value = "user", autoResultMap = true)
@RequiredArgsConstructor
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class User {
    @TableId(type = IdType.ASSIGN_ID)
    @NonNull
    @Alias("userId")
    private Integer id;
    @NonNull
    private String name;
    @NonNull
    private String pwd;

    @Version
    private Integer version;

    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    /**需要配置文件中定义1和0的含义*/
    private Integer valid;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT)
    private Date updateTime;
}
